package com.hopes.bizz.position.position.controller;

import com.hopes.bizz.position.position.dto.ReceiveRtPositionDTO;
import com.hopes.bizz.position.position.entity.PlPersonPositionHisEntity;
import com.hopes.bizz.position.position.service.PlPersonPositionRtService;
import com.hopes.boss.common.core.util.R;
import com.hopes.boss.common.log.annotation.SysLog;
import com.hopes.common.receive.annotation.RecordLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 员工实时定位数据
 * @time 2024/2/21 17:11
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/rtposition" )
@Tag(description = "rtposition" , name = "员工实时定位数据管理" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class PlPersonPositionRtController {

    private final PlPersonPositionRtService plPersonPositionRtService;

    /**
     * 上传人员实时数据接口
     * @param receiveRtPositionDTO 员工定位数据
     * @return R
     */
    @Operation(summary = "上传人员实时数据接口" , description = "上传人员实时数据接口" )
    @RecordLog(value = "上传人员实时数据接口", type = "EMPLOYEE_LOCATIONS")
    @PostMapping("/employee/locations")
    public R employeeLocations(@RequestBody ReceiveRtPositionDTO receiveRtPositionDTO) {
        return R.ok(plPersonPositionRtService.handleRtPosition(receiveRtPositionDTO));
    }

}
